From d22624b18e1123659dcbb6e069eab15ea3072828 Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Fri, 29 Jun 2012 18:30:53 -0400 Subject: [PATCH] menubutton: don't dereference NULL GdkEvent Since we explictly call popup_menu with NULL when it's keyboard-activated, we need to be careful and not access event->device without checking for event != NULL before. --- gtk/gtkmenubutton.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gtk/gtkmenubutton.c b/gtk/gtkmenubutton.c index 4c1a2f1efb..63bea8c824 100644 --- a/gtk/gtkmenubutton.c +++ b/gtk/gtkmenubutton.c @@ -307,7 +307,9 @@ popup_menu (GtkMenuButton *menu_button, break; } - gtk_menu_popup_for_device (GTK_MENU (priv->menu), event->device, NULL, NULL, + gtk_menu_popup_for_device (GTK_MENU (priv->menu), + event ? event->device : NULL, + NULL, NULL, func, GTK_WIDGET (menu_button), NULL, -- 2.30.2